package com.hxht.cmp.service.impl;

import com.hxht.cmp.entity.User;
import com.hxht.cmp.entity.UserRole;
import com.hxht.cmp.mapper.UserMapper;
import com.hxht.cmp.mapper.UserRoleMapper;
import com.hxht.cmp.service.UserService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author alice on 2017/7/3 0003.
 * @version 1.0
 * @since 1.0
 */
@Service
public class UserServiceImp implements UserService {
    @Resource
    private UserMapper userMapper;
    @Resource
    private UserRoleMapper userRoleMapper;

    @Override
    public User selectOne(User user) {
        return userMapper.selectOne(user);
    }

    @Override
    public List<UserRole> getUserRole(UserRole userRole) {
        return userRoleMapper.select(userRole);
    }

    @Override
    public List<Map<String, Object>> selectAllDeptAndPostInfo(String courtUid) {
        return userMapper.selectAllDeptAndPostInfo(courtUid);
    }

    @Override
    public List<Map<String, Object>> selectGroupUser(long userId) {
        return userMapper.selectGroupUser(userId);
    }

}
